<?php
session_start();
import_request_variables("gP");
header("Content-Type: text/html; charset=iso-8859-1");

    include('../Lib/php/conex.php');
	$linkA= conectaSQL("influenza","inf123456","influenza");
	include('../Lib/php/funciones.php');
?>

<script language="javascript" type="text/ecmascript" src="js/form.js"></script>
<script language="javascript" src="js/prototype.js"></script>
<script language="javascript" src="js/ajax.js"></script>

<?php


if($ideval >= 2 )
{
echo "<input type='hidden' value='0' id='subev_' name='subev_'>";
}
else
{
echo "<br>ESPECIFIQUE LA EVOLUCION:*";
$sqls= "SELECT id_principal, descripcion FROM cat_subevolucion where nEvolucion = $ideval";
	 $querys = mssql_query($sqls,$linkA) or die(mssql_get_last_message());
	 echo combo_sqlsrv($querys, "nsubevolucion", $datos["nsubevolucion"]); 



}
if($ideval == 2){
echo "<br>INTUBADO:*";
$sql= "select id_principal,cDecision from Cat_Decision";
	 $query = mssql_query($sql,$linkA) or die(mssql_get_last_message());
	 echo combo_sqlsrv($query, "nIntubacion", $datos["nIntubacion"]);
}
//abrir fecha de Egreso
if($ideval==4)
{
?>

<script>
document.getElementById('divfolio').style.display='block';	
</script>
<?php }else
{ ?> <script>
document.getElementById('divfolio').style.display='none';	
</script> <?php
}

if(($ideval == 1 || $ideval==4) )
{
?>

<script>
document.getElementById('divfecEgreso').style.display='block';	
</script>
<?php }else{
?>
<script>
document.getElementById('divfecEgreso').style.display='none';	
document.getElementById('fegreso').value='';
</script>
<?php }
//echo $ideval;
if( $ideval > 4 ){ echo "<script>document.getElementById('divfecEgreso').style.display='block';</script>";}
if($ideval == 7){echo "<script>	new Ajax.Updater('divReferencia', 'divReferencia.php', {evalScripts:true});</script>";}
if($ideval > 4 && $ideval < 7){echo "<script>	document.getElementById('divReferencia').innerHTML='<input type=hidden name=nUnidadReferir value=0>';</script>";}
if($ideval > 4 )
{
	?><script>
		//alert(test.servicio.value);
	if(document.test.servicio.value == 0){
		alert('Seleccione el Servicio');
		document.getElementById('nEvolucion').value = '0' ;
		}
	if(document.test.servicio.value == 15)
	{
		document.getElementById('fegreso').value='00/00/0000';
	}else
	{
		document.getElementById('fegreso').value='';
	}
	</script><?php
}


	

?>